package moxl.xpath.functions;

import moxl.xpath.XPathContext;
import moxl.xpath.parser.states.step.Function;
import moxl.xpath.parser.types.XPathNumberValue;
import moxl.xpath.parser.types.AbstractXPathValue;

public class PositionFunction implements Function
{
	public AbstractXPathValue execute(XPathContext context, AbstractXPathValue... args) throws XPathFunctionIllegalArgumentException
	{
		int position = context.getPosition();
		return new XPathNumberValue(position);
	}

	public String getName()
	{
		return "position";
	}

}
